package com.webster.isw.core.service.impl;


import com.webster.isw.core.service.BaseService;
import com.webster.isw.core.service.ParamService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * [PROPAGATION_REQUIRED]:如果存在一个事务，则支持当前事务。如果没有事务则开启。
 * [rollbackFor = Exception.class]当你的方法中抛出异常时，它会将事务回滚
 * Created by Webster on 2016-5-6.
 */

@Service("baseService")
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class BaseServiceImpl implements BaseService {

    /**
     * Field logger: 日志
     */
    private Logger logger = LoggerFactory.getLogger(this.getClass());

    /**
     * Field ps: 参数获取服务
     */
    @Resource
    private ParamService paramService;

    @Override
    public Logger getLogger() {
        return logger;
    }

    @Override
    public ParamService getParamService() {
        return paramService;
    }



}
